<?php
class DBProperties{

	private $userName = "";
	private $password = "";
	private $database = "";
	private $host = "";
	private static $FILE_NAME = "../../resources/data/dbparams.txt";

	function __construct(){

		if(file_exists(self::$FILE_NAME)){
			$fp = fopen(self::$FILE_NAME, "r" );
			$this -> userName = trim(fgets($fp));
			$this -> password = trim(fgets($fp));
			$this -> database = trim(fgets($fp));
			$this -> host = trim(fgets($fp));
			fclose($fp);
		}

		else{
			$this -> userName = "is502";
			$this -> password = "is502";
//			$this -> database = "iipis_budget";
			$this -> database = "iipis_db";
			$this -> host = "localhost";			
		}
	}

	public function getUserName(){
		return $this -> userName;
	}
	
	public function getPassword(){
		return $this -> password;
	}
	
	public function getDatabase(){
		return $this -> database;
	}
	
	public function getHost(){
		return $this -> host;
	}
}
?>